﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Aden.Model.Net;

namespace AdenWebAPI.Controllers
{
    public class YYCController : BaseController
    {
        [HttpPost]
        public Response InitCheckin(string token, [FromBody]string param)
        {
            Response response = new Response();

            if (string.IsNullOrEmpty(token) || !token.Equals(_token))
            {
                response.code = "404";
                response.message = "Invild token";
            }
            else
            {
                try
                {
                    var data = DateTime.Now.ToString("dddd  M月d日",
                        new System.Globalization.CultureInfo("zh-cn"));//
                    if (data == null)
                        throw new Exception("No data");

                    response.code = "200";
                    response.content = data;

                }
                catch (Exception e)
                {
                    response.code = "500";
                    response.message = e.Message;
                }
            }

            return response;
        }
    }
}
